package top.xqf.homework.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.xqf.homework.base.BaseResult;
import top.xqf.homework.entity.TbYsArms;
import top.xqf.homework.service.ArmsService;


import java.util.List;

@RestController
@RequestMapping("/arms")
public class ArmsController {
    @Autowired
    private ArmsService armsService;

    @GetMapping("/query")
    public BaseResult<List<TbYsArms>> query(TbYsArms tbYsArms) throws Exception {
        return armsService.query(tbYsArms);
    }

    @PostMapping("/add")
    public BaseResult<TbYsArms> add(TbYsArms tbYsArms) throws Exception{
        return armsService.add(tbYsArms);
    }

    @PostMapping("/update")
    public BaseResult<TbYsArms> update(TbYsArms tbYsArms) throws Exception{
        return armsService.update(tbYsArms);
    }

    @PostMapping("/delete")
    public BaseResult<TbYsArms> delete(TbYsArms tbYsArms) throws Exception{
        return armsService.delete(tbYsArms);
    }
}
